home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16171 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  938 b 

  1. Path: news.production.compuserve.com!news
  2. From: Steve Farson <75226.1623@CompuServe.COM>
  3. Newsgroups: comp.lang.c++
  4. Subject: Array Summary Algorithm
  5. Date: 9 Apr 1996 21:02:50 GMT
  6. Organization: CompuServe, Inc. (1-800-689-0736)
  7. Message-ID: <4kej9q$fhf$1@mhadg.production.compuserve.com>
  8.  
  9. Has anyone ever heard of, or seen an algorithm that can summarize 
  10. the contents of an array.  What I mean is this... if an array 
  11. looks like this:
  12.  
  13. New York        10
  14. Delaware        12
  15. New York        15
  16. Indiana            12
  17. Delaware        10
  18.  
  19. Create a summary array from the preceeding to look like this:
  20. New York        25
  21. Delaware        22
  22. Indiana            12
  23.  
  24. It would be similar to SQL GROUP BY, or the XBase TOTAL ON.  I 
  25. think it would be stimulating to come up with the code to do 
  26. this.  I may give it a try if I can find the time, but thought 
  27. I'd ask here if anyone had some insight or advice or example on 
  28. how to do this.
  29.  
  30. Thanks for any thoughts.  Steve
  31. Thanks for any thoughts.
  32.  
  33. Steve
  34.